import http from '@/utils/http'
/**
 * 广告区域
 * @param {Number} distributionSite 投放位置，1为首页，2为分类商品页 默认是1
 * @returns 
 */


export const getHomeBanner = (distributionSite = 1) => {
    return http({
        url: "/home/banner",
        data: { distributionSite },
    });
}
/**
 * 
 * 前台类目
 */
export const getHomeCategoryHeadMutli = () => {
    return http({ url: '/home/category/head/mutli' })
}
/**
 * 
 * 人气推荐
 */
export const getHomeHotMutli = () => {
    return http({
        url: "/home/hot/mutli"
    })
}
/**
 * 
 * @param {Number} limit 数据条数
 * @returns 
 */
export const getHomeNew = (limit = 4) => {
    return http({
        url: '/home/new',
        data: { limit }
    })
}
/**
 * 
 * @param {object} data 
 * page:页码
 * pageSize:单页请求数据条数 
 */
export const getGoodsGuessLike = (data) => {
    return http({
        url: '/home/goods/guessLike',
        data
    })
}
/**
 * 统一获取推荐页面的数据
 * @param {String} url 推荐页面用到的url
 * @param {Object} data 参数
 * @returns 
 */
export const getHomeRecommend = (url, data = {}) => {
    return http({ url, data })
}